<?php


namespace app\admin\controller;


use think\facade\Request;
use app\admin\model\AppUpdateLog as AppUpdateLogModel;

class AppUpdateLog extends ApiCommon
{
    /**
     * 用于判断权限
     * @permission 无限制
     * @allow 登录用户可访问
     * @other 其他根据系统设置
     */
    public function initialize()
    {
        parent::initialize();
        $action = [
            'permission' => [],
            'allow' => [],
        ];
        event('CheckAuth',$action);
        $request = Request::instance();
        $a = strtolower($request->action());
        if (!in_array($a, $action['permission'])) {
            parent::initialize();
        }
    }


    /**
     * APP更新日志
     * @author Mr.Li
     * @param
     * @return
     */
    public function index(AppUpdateLogModel $appLogModel )
    {
        try{
            $data   = $appLogModel->getList($this->param);
        }catch (\Exception $e){
            return resultArray(['error' => $e->getMessage()]);
        }
        return resultArray(['error'=>'获取成功','data' => $data]);
    }

}
